home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_keyline.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  90 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_MoveObj.cog
  4. #
  5. #
  6. # A hack for pushing blocks around. Inspired by Reed Derleth
  7. # IMPORTANT. Make sure you attach the cog to a valid object.
  8. # Make sure that the ghostthing is assigned to a ghost object.
  9. #
  10. # Usage:
  11. # -Get behind the object (face the direction you want it to go)
  12. # -Activate once to push forward.
  13. # -Activate twice rapidly to pull. (the object will materialise on top of you just walk forward)
  14. # -You can teleport things out of the world so be careful
  15. #
  16. # [SXC]
  17. #
  18. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  19. # ========================================================================================
  20.  
  21. symbols
  22.  
  23.     message     startup
  24.     message     entered
  25.     message        taken
  26.     
  27.     sound       keyline
  28.     
  29.     sector      entersector
  30.     
  31.     thing       key
  32.  
  33.     vector      playervec           local
  34.  
  35.     thing       player0             local
  36.  
  37.     float       playery=0           local
  38.     float       playerx=0           local
  39.     int         check=0             local
  40.     int         keytaken=0          local
  41.  
  42. end
  43.  
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. startup:
  50.     player0 = GetLocalPlayerThing();
  51.     return;
  52.  
  53. # ........................................................................................
  54.  
  55. entered:
  56.     if ((GetSenderRef() == entersector) && (GetSourceRef() == player0) && (check == 0) && (keytaken == 0))
  57.     {
  58.         playervec = GetThingLVec(player0);
  59.         playery = VectorY(playervec);
  60.         playerx = VectorX(playervec);
  61.  
  62.         if ((playery > 0) &&
  63.            ((playerx > -0.7) && (playerx < 0.7))) 
  64.         {
  65.             check = 1;
  66.                PlayVoice(player0, keyline, 1.0, 0); 
  67.         }
  68.     }        
  69.     return;
  70.     
  71. # ........................................................................................
  72.  
  73. taken:
  74.     if (GetSenderRef() == key)
  75.     {
  76.         keytaken = 1;
  77.     }
  78.     return;        
  79.     
  80.     end
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.